//
//  ByCellOrderEvaluateSecond.m
//  itboye_shop_ios
//
//  Created by mc on 17/2/9.
//  Copyright © 2017年 com.itboye. All rights reserved.
//

#import "ByCellOrderEvaluateSecond.h"
@interface ByCellOrderEvaluateSecond()
@property (nonatomic, strong) UILabel     *msxfLable;
@property (nonatomic, strong) UILabel     *wlfwLable;
@property (nonatomic, strong) UILabel     *fwtdLable;

@property (nonatomic, strong) UIImageView *img;
@property (nonatomic, strong) UILabel     *storeLabel;
@end

@implementation ByCellOrderEvaluateSecond

+ (instancetype)cellWithTableView:(UITableView*)tableView{
    
    static NSString *cellIdentifier = @"ByCellOrderEvaluateSecond";
    ByCellOrderEvaluateSecond *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[self alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
    }
    return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSeparatorStyleNone;
        [self setupSubViews];
    }
    return self;
}
- (void)setupSubViews{
    
    self.msxfLable  = [[UILabel alloc] init];
    self.wlfwLable  = [[UILabel alloc] init];
    self.fwtdLable  = [[UILabel alloc] init];
    self.storeLabel = [[UILabel alloc] init];
    
    self.img        = [[UIImageView alloc] init];
    self.img.image  = [UIImage imageNamed:@"product_detail_tool_shop"];
    
    self.msxfLable.font = FONT(14);
    self.msxfLable.textColor = [UIColor lightGrayColor];
    self.msxfLable.text = @"描述相符";
    
    self.wlfwLable.font = FONT(14);
    self.wlfwLable.textColor = [UIColor lightGrayColor];
    self.wlfwLable.text = @"物流态度";
    
    self.fwtdLable.font = FONT(14);
    self.fwtdLable.textColor = [UIColor lightGrayColor];
    self.fwtdLable.text = @"服务态度";
    
    self.storeLabel.font = FONT(14);
    self.storeLabel.textColor = [UIColor blackColor];
    self.storeLabel.text = @"店铺评分";
    
    self.msxfRatingStar = [[ByViewOrderDetailEvaluate alloc] init];
    self.wlfwRatingStar = [[ByViewOrderDetailEvaluate alloc] init];
    self.zstdRatingStar = [[ByViewOrderDetailEvaluate alloc] init];
    [self.contentView addSubview:self.msxfLable];
    [self.contentView addSubview:self.wlfwLable];
    [self.contentView addSubview:self.fwtdLable];
    [self.contentView addSubview:self.img];
    [self.contentView addSubview:self.storeLabel];
    
    [self.contentView addSubview:self.msxfRatingStar];
    [self.contentView addSubview:self.wlfwRatingStar];
    [self.contentView addSubview:self.zstdRatingStar];
    

    
    CGFloat x,y,width,height;
    //店铺图标
    x      = 10;
    y      = 5;
    width  = 25;
    height = 25;
    self.img.frame = CGRectMake(x, y, width, height);
    
    //店铺评分
    x      = self.img.right + 10;
    width  = SCREEN_WIDTH - x;
    height = 25;
    self.storeLabel.frame = CGRectMake(x, y, width, height);
    
    //描述相符
    height = 20;
    width  = 60;
    x      = 10;
    y      = 5 + 35;
    self.msxfLable.frame = CGRectMake(x, y, width, height);

    //物流态度
    height = 20;
    width  = 60;
    y      = 30 + 35;
    self.wlfwLable.frame = CGRectMake(x, y, width, height);
    
    //服务态度
    y      = 55 + 35;
    self.fwtdLable.frame = CGRectMake(x, y, width, height);

    
    //描述相符图片
    x      = self.msxfLable.right + 10;
    y      = 5 + 35;
    height = 20;
    width  = 200;
    self.msxfRatingStar.frame = CGRectMake(x, y, width, height);
    
    //物流态度
    y      = 30 + 35;
    self.wlfwRatingStar.frame = CGRectMake(x, y, width, height);
    
    //服务态度
    y      = 55 + 35;
    self.zstdRatingStar.frame = CGRectMake(x, y, width, height);
    
    
    self.msxfRatingStar.padding = 10.f;
    self.wlfwRatingStar.padding = 10.f;
    self.zstdRatingStar.padding = 10.f;
    self.msxfRatingStar.touchEnable = self.wlfwRatingStar.touchEnable = self.zstdRatingStar.touchEnable = NO;
    self.msxfRatingStar.starSize = self.wlfwRatingStar.starSize = self.msxfRatingStar.starSize =  CGSizeMake(20, 20);
    
}

@end
